package ejb.entities;

import java.io.Serializable;

import javax.persistence.*;

import java.util.Date;

/**
 * The persistent class for the user_basicproduct database table.
 * 
 */
@Entity
@Table(name = "user_basicproduct")
@NamedQueries({
		@NamedQuery(name = "UserBasicproduct.findAll", query = "SELECT u FROM UserBasicproduct u"),
		@NamedQuery(name = "UserBasicproduct.findByUserAndBP", query = "SELECT u FROM UserBasicproduct u WHERE u.basicproduct.basicproductid LIKE :bpid AND u.user.userid LIKE :uid") })
public class UserBasicproduct implements Serializable {
	private static final long serialVersionUID = 1L;

	public static final String FINDBYUSERBP = "UserBasicproduct.findByUserAndBP";

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private int id;

	@Temporal(TemporalType.DATE)
	private Date date;

	// bi-directional many-to-one association to Basicproduct
	@ManyToOne
	@JoinColumn(name = "basicproductid")
	private Basicproduct basicproduct;

	// bi-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name = "userid")
	private User user;

	public UserBasicproduct() {
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Date getDate() {
		return this.date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public Basicproduct getBasicproduct() {
		return this.basicproduct;
	}

	public void setBasicproduct(Basicproduct basicproduct) {
		this.basicproduct = basicproduct;
	}

	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

}